// ======判断是否需要安装CLodop云打印服务器:======
function needCLodop () {
  try {
    let ua = navigator.userAgent;
    if (ua.match(/Windows\sPhone/i) !== null) return true;
    if (ua.match(/iPhone|iPod/i) !== null) return true;
    if (ua.match(/Android/i) !== null) return true;
    if (ua.match(/Edge\D?\d+/i) !== null) return true;

    let verTrident = ua.match(/Trident\D?\d+/i);
    let verIE = ua.match(/MSIE\D?\d+/i);
    let verOPR = ua.match(/OPR\D?\d+/i);
    let verFF = ua.match(/Firefox\D?\d+/i);
    let x64 = ua.match(/x64/i);
    if ((verTrident === null) && (verIE === null) && (x64 !== null)) { return true; } else if (verFF !== null) {
      verFF = verFF[0].match(/\d+/);
      if ((verFF[0] >= 41) || (x64 !== null)) return true;
    } else if (verOPR !== null) {
      verOPR = verOPR[0].match(/\d+/);
      if (verOPR[0] >= 32) return true;
    } else if ((verTrident === null) && (verIE === null)) {
      let verChrome = ua.match(/Chrome\D?\d+/i);
      if (verChrome !== null) {
        verChrome = verChrome[0].match(/\d+/);
        if (verChrome[0] >= 41) return true;
      }
    }
    return false;
  } catch (err) { return true; }
}

export {
  needCLodop,
};
